package entity;

public class MoveGenerator {
	
	public static Position move(Position position,Direction dir,int speed,Class<?> cls) {
		String objName = cls.getName();
		switch (dir) {
			case UP:
				position.setY(position.getY()-speed);
				break;
			case DOWN:
				position.setY(position.getY()+speed);
				break;
			case LEFT:
				position.setX(position.getX()-speed);
				break;
			case RIGHT:
				position.setX(position.getX()+speed);
				break;
			default:
				break;
		}
		//MessageHandler.getInstance().transfor(new MessageInfo(400, "移动到坐标"+position, "127.0.0.1"));
		return position;
	}
	
}
